<template>
  <div id="handle">
    <!-- 个人业务-->
    <h1>你需要办理的业务如下:</h1>
    <ol>
      <li><h3 style="font-family: 华文宋体">转账:</h3>
        <ol>
          <li>转账姓名:
            <el-input v-model="iname" placeholder="请输入内容" style="width: 230px"></el-input>
          </li>
          <li>转账账户:
            <el-input v-model="iaccount" placeholder="请输入内容" style="width: 230px"></el-input>
          </li>
          <li>转账金额:
            <el-input v-model="money" placeholder="请输入内容" style="width: 230px">></el-input>
          </li>
          <li>
            <el-radio v-model="transfer" label="se">安全转账</el-radio>
            <el-radio v-model="transfer" label="sp">快速转账</el-radio>
            <el-button @click="TransferMoney">确定</el-button>
          </li>
        </ol>
      </li>
      <li>申请(权限提高):
        <el-checkbox v-model="search" >查询</el-checkbox>
        <el-checkbox v-model="update" >修改</el-checkbox>
        <el-checkbox v-model="remove" >删除</el-checkbox>
        <el-checkbox v-model="edit" >编辑</el-checkbox>
        <el-button @click="Apply">确定</el-button>
      </li>
      <li>
        <ol>
          <li><h3 style="font-family: 华文宋体">注销账号:</h3></li>
          <li>
            <el-radio v-model="logout" label="le">挂失</el-radio>
            <el-radio v-model="logout" label="de">注销</el-radio>
            <el-button>确定</el-button>
          </li>
        </ol>
      </li>
    </ol>
  </div>
</template>

<script>
import axios from "axios";


export default {
  name: "SingleSHandle",
  data() {
    return {
      transfer: '',
      iname: "",
      money: 0,
      logout: '',
      iaccount:''
    }
  },
  methods: {
    TransferMoney() {
      this.param = {
        userName: this.iname,
        account:this.iaccount,
        currentAccount:JSON.parse(localStorage.getItem("user")).account,
        money:this.money,
        transferName:this.transfer
      };
      console.log(this.transfer);

      if (this.transfer == 'sp') {
        axios.post('api/work/TransferMoney', this.param, false).then((res) => {
          // console.log(res.data.data);
          this.$message({
            message: res.data.data,
            type: 'success', // 设置消息类型为提示
            duration: 1000, // 设置消息显示时间为3秒，默认是2000毫秒
          });
        }).catch(error => {
          console.log(error)
          this.$message({
            message: error,
            type: 'success', // 设置消息类型为提示
            duration: 1000, // 设置消息显示时间为3秒，默认是2000毫秒
          });
          return;
        })
      }
    }
  }
}
</script>


<style scoped>
#handle {
  width: 1000px;
  margin: 30px;
}

ul li {
  font-family: 华文宋体;

}
</style>
